/*    */ package net.sourceforge.appgen.model;
/*    */ 
/*    */ import java.io.Serializable;
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ import net.sourceforge.appgen.converter.FirstCharacterLowerCaseConverter;
/*    */ import net.sourceforge.appgen.converter.StringConverter;
/*    */ import net.sourceforge.appgen.util.ConventionUtils;
/*    */ 
/*    */ public class Criteria
/*    */   implements Serializable
/*    */ {
/*    */   private static final long serialVersionUID = 1L;
/* 34 */   private static final StringConverter firstCharacterLowerCaseConverter = new FirstCharacterLowerCaseConverter();
/*    */   private Entity entity;
/*    */ 
/*    */   public Criteria(Entity entity)
/*    */   {
/* 39 */     this.entity = entity;
/*    */   }
/*    */ 
/*    */   public String getClassName() {
/* 43 */     return this.entity.getClassName() + "Criteria";
/*    */   }
/*    */ 
/*    */   public String getInstanceName() {
/* 47 */     return firstCharacterLowerCaseConverter.convert(getClassName());
/*    */   }
/*    */ 
/*    */   public String getFullPackageName() {
/* 51 */     return this.entity.getPackageName() + ".criteria";
/*    */   }
/*    */ 
/*    */   public String getSuperClassName() {
/* 55 */     return "Criteria";
/*    */   }
/*    */ 
/*    */   public String getSuperClassFullPackageName() {
/* 59 */     return this.entity.getPackageName() + ".base";
/*    */   }
/*    */ 
/*    */   public List<String> getImportClassNameList() {
/* 63 */     List list = new ArrayList();
/*    */ 
/* 65 */     list.add(getSuperClassFullPackageName() + "." + getSuperClassName());
/*    */ 
/* 67 */     if (this.entity.getPrimaryKeyFieldList() != null) {
/* 68 */       for (Field field : this.entity.getPrimaryKeyFieldList()) {
/* 69 */         if ((!field.isCreate()) || (field.getFieldType().indexOf('.') <= 0) || 
/* 70 */           (field.getFieldType().equals("java.lang." + field.getSimpleFieldType())) || 
/* 71 */           (list.contains(field.getFieldType()))) continue;
/* 72 */         list.add(field.getFieldType());
/*    */       }
/*    */ 
/*    */     }
/*    */ 
/* 79 */     return list;
/*    */   }
/*    */ 
/*    */   public List<String> getImportDeclarations() {
/* 83 */     List list = new ArrayList();
/* 84 */     list.addAll(getImportClassNameList());
/*    */ 
/* 86 */     return ConventionUtils.getImportDeclarations(list, getFullPackageName());
/*    */   }
/*    */ 
/*    */   public Entity getEntity() {
/* 90 */     return this.entity;
/*    */   }
/*    */ 
/*    */   public void setEntity(Entity entity) {
/* 94 */     this.entity = entity;
/*    */   }
/*    */ }

/* Location:           C:\Users\lzl6066\Downloads\net.sourceforge.appgen_1.2.0\plugins\net.sourceforge.appgen_1.2.0.201002031718\
 * Qualified Name:     net.sourceforge.appgen.model.Criteria
 * JD-Core Version:    0.6.0
 */